<?php
namespace app\admin\model;

//use \think\View;
use think\helper\hash\Md5;
use \think\Model;

class Admin extends Model
{
    //添加
    public function addAdmin($data){
        if (empty($data) || !is_array($data)){
            return false;
        }
        if ($data['password']){
            $data['password'] = md5($data['password']);
        }
        if($this->save($data)){
            return true;
        }else{
            return false;
        }

    }

    //获取
    public function  getAdmin(){
        return $this::paginate(5);
    }



}
